from w1thermsensor import W1ThermSensor
import time

# 自动检测传感器
sensor = W1ThermSensor()

while True:
    temp = sensor.get_temperature()
    print(f"温度: {temp:.2f}°C")
    time.sleep(1)